package com.michael.starter.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OpenApiConfig {

    @Value("${spring.application.name}")
    private String name;
    @Value("${spring.application.desc}")
    private String desc;
    @Value("${spring.application.version}")
    private String ver;

    @Bean
    public OpenAPI registerOpenAPI() {
        Info info = new Info()
                .title(name)
                .description(desc)
                .version(ver);
        return new OpenAPI().info(info);
    }

}